import java.io.File;
import java.util.Scanner;


public class Invitacion {

	private File entrada;
	private File salida;
	private string front;
	private string body;
	private string back;
	
	public Invitacion (){
		entrada = new File("invitation.xml");
		salida = new File("invcss.html");
		if (salida.exists()) {
			salida.delete();
			salida.createNewFile();
		}
	}
	
	public Invitacion (string in, string out){
		entrada = new File(in);
		salida = new File(out);
		if (salida.exists()) {
			salida.delete();
			salida.createNewFile();
		}
	}
	
	private void Read () {
		Scanner reader = new Scanner (entrada);
		String basura;
		String aux;
		reader.useDelimiter("<front>"|"<body>"|"<back>");
		basura = reader.next();
		reader.useDelimiter("<\front>"|"<\body>"|"<\back>");
		aux = reader.next();
		if (aux.regionMatches(0,"<front>",0,6))
			front = aux;
		else
			if (aux.regionMatches(0,"<body>",0,6))
				body = aux;
			else
				if (aux.regionMatches(0,"<back>",0,6))
					back = aux;
				else
					system.out.println ("la has cagado mija");
				
		/*
		reader.useDelimiter("<\front>");
		front = reader.next();
		//Leer body
		reader.useDelimiter("<body>");
		basura = reader.next();
		reader.useDelimiter("<\body>");
		body = reader.next();
		//Leer back
		reader.useDelimiter("<back>");
		basura = reader.next();
		reader.useDelimiter("<\back>");
		back = reader.next(); */
		reader.close();
	}
	
	private void Write () {
		
	}
	public static void main(String[] args) {
		Invitacion i = new Invitacion ();
		//Invitacion i = new Invitacion (args[0], args[1]);
		i.Read();
		entrada.close();
		i.Write();
		salida.close(); 
	}

}
